#include <stdio.h>
#include <stdlib.h>
#include<time.h>

double unfoldPiTaylor(int num) {
	double sum = 0;
	int flag = 1;
	for (int i = 0; i < num; i++) {
		sum += (flag ? (1.0 / (2 * i + 1)) : (-1.0 / (2 * i + 1)));
		flag = !flag;
	}
	return sum * 4;
}

int main0() {
	clock_t start, finish;
	int timSum = 0;
	int num = 0;
	int term = 0;
	int n = 100;
	scanf("%d %d", &n, &num);
	for (int j = 0; j < n; j++) {
		start = clock();
		double pi = unfoldPiTaylor(num);
		term = (int)(clock() - start);
		timSum += term;
		printf("one term done , duration: %d ms %.9lf\n", term, pi);
	}
	printf("total time: %d ms. averange: %.1lf ms\n", timSum, double(timSum) / n);
	return 0;
}

int is_prime(long n) {
	long i = 2L;
	while (i < n) {
		if (n % i == 0) {
			return 0;
		}
		i += 1;
	}
	return 1;
}

int main() {
	long NUM = 111181111L;
	int n;
	int sum=0;
	scanf("%d, %ld", &n, &NUM);
	clock_t start = clock();
	for (int i = 0; i < n; i++)
		sum += is_prime(NUM);
	int term = (int)(clock() - start);
	printf("%d, %d\n", term, sum);
}